package tech.wetech.admin3.config;

import com.alipay.api.AlipayConfig;
import com.alipay.easysdk.kernel.Config;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import tech.wetech.admin3.sys.model.AliPayProperties;

@Configuration
@Data
public class AliPayConfig {
  @Bean
  public Config config(AliPayProperties payProperties) {
    Config config = new Config();
    config.protocol = payProperties.getProtocol();
    config.gatewayHost = payProperties.getGatewayHost();
    config.signType = payProperties.getSignType();
    config.appId = payProperties.getAppId();
    config.merchantPrivateKey = payProperties.getMerchantPrivateKey();
    config.alipayPublicKey = payProperties.getAlipayPublicKey();
    config.notifyUrl = payProperties.getNotify_url();
    config.encryptKey = "";
    return config;
  }


}
